package com.amit.Basic_Simple_Program;

import java.util.Scanner;

public class Pascal_Triangle {

	public static void main(String[] args) {
		int c,i;
		System.out.println("Please enter the number for row");
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		
		for( i=0;i<n;i++)
		{
			for(c=0;c<=(n-i-2);c++)
			
				System.out.println(" ");
			
			
			for(c=0;c<i;c++)
				System.out.println(factorial(i)/(factorial(c)*(factorial(i-c))));
			System.out.println();
				
		}
		
		

	}

	private static long factorial(int n) {
		
		int c;
		int result=1;
		for( c=1;c<=n;c++)
		{
			result=c*result;
		}
		return result;
	}

}
